home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / atari / birkhahn-metafont-packed-disks / mf27-2_2e-disk2.zoo / inputs / committe.lzs / FONT1BAS.MF < prev    next >
Text File  |  1989-12-13  |  3KB  |  114 lines

  1. delimiters ();
  2. smoothing:=1; autorounding:=2;  % this adjusts curves to the raster
  3. turningcheck:=2;  % this will warn about a "strange path"
  4.  
  5. vardef z@# = (x@#,y@#) enddef;
  6. vardef dz@# = (dx@#,dy@#) enddef;
  7.  
  8. picture currentpicture;
  9. currentpicture=nullpicture; % this initializes an empty set of pixels
  10.  
  11. def fill expr c = addto currentpicture contour c enddef;
  12. def shipit = shipout currentpicture enddef;
  13. def showit = display currentpicture inwindow window enddef;
  14.  
  15. def unknown = not known enddef;
  16.  
  17. vardef pos@#(expr length,theta) =
  18.   z@#=.5[z@#l,z@#r];
  19.   z@#r-z@#l=(length,0) rotated theta enddef;
  20. def stroke(suffix $,$$)(expr t,lt,rt) =
  21.   fill z$l
  22.    if known dz$: {dz$} fi
  23.    if t<>0: ..lt[ t[z$l,z$$l],t[z$,z$$] ]{z$$l-z$l} fi
  24.    .. z$$l
  25.     if known dz$$: {dz$$} fi
  26.   & z$$l..z$$r
  27.   & z$$r
  28.     if known dz$$: {-dz$$} fi
  29.    if t<>0: ..rt[ t[z$r,z$$r],t[z$,z$$] ]{z$r-z$$r} fi
  30.    .. z$r
  31.    if known dz$: {-dz$} fi
  32.   & z$r..z$l & cycle;
  33.   showit; enddef;
  34. def curve(suffix $,$$,$$$) =
  35.   fill z$l
  36.    if known dz$: {dz$} fi
  37.   .. z$$l{if known dz$$: dz$$ else: z$$$l-z$l fi}
  38.   .. z$$$l
  39.    if known dz$$$: {dz$$$} fi
  40.   & z$$$l..z$$$r
  41.   & z$$$r
  42.    if known dz$$$: {-dz$$$} fi
  43.   .. z$$r{if known dz$$: -dz$$ else: z$r-z$$$r fi}
  44.   .. z$r
  45.    if known dz$: {-dz$} fi
  46.   & z$r..z$l & cycle;
  47.   showit; enddef;
  48.  
  49. def proofrule(expr a,b) =
  50.   special "rule"; numspecial xpart a; numspecial ypart a;
  51.   numspecial xpart b; numspecial ypart b enddef;
  52. string lcode_;
  53. lcode_=" 0"; % change to " /" to avoid listing in overflow column
  54. def makelabel(expr s,z) = % puts string s at point z
  55.   if known z: special lcode_ & s;
  56.     numspecial xpart z; numspecial ypart z fi enddef;
  57. def labelpos(text t) =
  58.   if proofing>.5:
  59.   forsuffixes $$=l,,r: forsuffixes $=t:
  60.     makelabel(str $.$$, z$.$$); endfor endfor fi enddef;
  61.  
  62.  
  63. def clear =
  64.   numeric x[],y[],x[]l,y[]l,x[]r,y[]r,dx[],dy[];
  65.   currentpicture:=nullpicture;
  66. enddef;
  67.  
  68. def setwidth expr x =
  69.   chardx:=x;
  70.   numeric w; w=chardx;
  71.   if proofing>.5:
  72.   for n:=0 step .1em until chardx-1:
  73.    proofrule((n,-ydepth),(n,hheight)); endfor
  74.   proofrule((chardx,-ydepth),(chardx,hheight));
  75.   proofrule((0,-ydepth),(chardx,-ydepth));
  76.   proofrule((0,0),(chardx,0));
  77.   proofrule((0,xheight),(chardx,xheight));
  78.   proofrule((0,capheight),(chardx,capheight));
  79.   proofrule((0,hheight),(chardx,hheight));
  80.   fi
  81. enddef;
  82.  
  83. vardef init.normal(expr f) =
  84.   begingroup
  85.   numeric thinwidth,thickwidth,capheight,xheight,hheight,ydepth,em;
  86.   thinwidth = 11f; thickwidth = 15f; em = 200f;
  87.   capheight = 130f; xheight = 90f; hheight = 140f; ydepth = 40f;
  88.   endgroup
  89. enddef;
  90.  
  91. vardef init.bold(expr f) =
  92.   init.normal(f); thinwidth:= 14f; thickwidth:= 24f;
  93. enddef;
  94.  
  95. vardef init.boldx(expr f) =
  96.   init.bold(f); xheight:=95f; em:= 220f;
  97. enddef;
  98.  
  99.  
  100. vardef test@#(text #)=
  101.   begingroup
  102.   if str @# = "": % test all three
  103.     openwindow 1 from (0,0) to (420,167) at (-20,310);
  104.     openwindow 2 from (0,167) to (420,333) at (-20,310);
  105.     openwindow 3 from (0,333) to (420,500) at (-20,310);
  106.     window:=1; init.normal(1); clear; #; "normal"; shipit;
  107.     window:=2; init.bold(1); clear; #; "bold"; shipit;
  108.     window:=3; init.boldx(1); clear; #; "boldx"; shipit;
  109.   else:  openwindow 0 from (0,0) to (420,500) at (-40,310);
  110.     window:=0; init@#(2); clear; #; str @#; shipit;
  111.   fi;
  112.   endgroup
  113. enddef;
  114.